package com.xiaobai.design_pattern.strategy;

/**
 * @author wangtw
 * @ClassName ContextClient
 * @description: 环境角色（上下文角色）
 * @date 2023/6/418:35
 */
public class ContextClient {

    private DiscountStrategy discountStrategy;

    public ContextClient(DiscountStrategy discountStrategy) {
        this.discountStrategy = discountStrategy;
    }

    public double contextCalDisc() {
        return discountStrategy.calculateDiscount();
    }
}
